Every digital computing device may be segregated into one of two mutually exclusive classes depending upon how it orders individual data units in multi-unit transfer. The members of these two classes are known as either "big endian" or "little endian" devices. In current digital computing devices, eight data bits, a "byte," is typically the smallest individually addressable data unit. Most digital computing devices, however, transfer one to eight bytes at a time identified by the address of a single byte in the transfer and some size signal. Therefore, it becomes relevant how the device orders each of the bytes relative to the single address of the data transfer.
Big endian devices assign the lowest address to the most significant byte of the multi-unit transfer (left-most byte), the next sequential address to the next most significant byte of the transfer, etc. This strategy is referred to as big endian because the big end of the multi-unit transfer (considered as a binary number) comes first in storage. IBM's RISC System/6000, IBM's System 370 and Motorola's 68000 family of microprocessors are examples of big endian devices.
Little endian devices assign the lowest address to the least significant byte of the multi-unit transfer (right-most byte), the next sequential address to the next least significant byte of the transfer, etc. This strategy is referred to as little endian because the little end of the multi-unit transfer (considered as a binary number) comes first in storage. DEC's VAX architecture and Intel's X86 family of microprocessors are examples of little endian devices.
Oftentimes it is desirable to combine a big endian device and a little endian device in the same digital computing system. Multi-unit data transfers between the big endian device and the little endian device must be reordered. Otherwise, the data output by one device would not be intelligible to the other device. There are at least two strategies used to reorder data in multi-unit transfers: "programmed byte-swapping" and "address munging."
Programmed byte-swapping is a solution which incorporates a certain number of multiplexers interposed in the data path connecting the two different devices. These multiplexers perform the byte reordering depending upon the data transfer size and data path size. For instance, if both devices transfer data in up to four byte quanta (both have 32-bit data buses), then each byte must have a 4:1 multiplexer connected to it to route any one of the four incoming bytes to any one of the four byte lanes.
Address munging is a solution that reorders data transferred from big endian devices to little endian devices. This solution combines two steps. First, the address of each data transfer destined for the little endian device is modified or "munged" to form a second address according to a particular mathematical function. The data transfer is indexed by this second address. Second, the bytes of the data transfer are reversed with respect to the data path.